package com.company.bookstore.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.company.bookstore.entities.order_module.Logistics;
import com.company.bookstore.entities.order_module.OrderImg;
import com.company.bookstore.mapper.order_module.LogisticsMapper;
import com.company.bookstore.mapper.order_module.OrderImgMapper;
import com.company.bookstore.service.order_module.LogisticsService;
import com.company.bookstore.service.order_module.OrderImgService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Random;
import java.util.UUID;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 赵云霞
 * @since 2020-09-08
 */
@Service
public class OrderImgServiceImpl extends ServiceImpl<OrderImgMapper, OrderImg> implements OrderImgService {


    @Resource
    OrderImgMapper orderImgMapper;

    @Override
    public List<OrderImg> saveOrderImg(List<OrderImg> orderImgs) {

        for(int i=0;i<orderImgs.size();i++){
            orderImgs.get(i).setDeleted(0);
        }
        saveBatch(orderImgs);

        return orderImgs;
    }

    @Override
    public List<OrderImg> getByOid(int oid) {
        return orderImgMapper.getOrderImgList(oid);
    }
}
